class Device {
	static belongsTo = [devicegroup:Devicegroup]
	static hasMany = [ eventdatas : Eventdata, diagnostics:Diagnostic ]
	
	// Fields	
	  //String uniqueId;
	  String equipmentType='';
	  //String vehicleId;
	  
	  boolean allowNotify=true;
	  String notifyEmail='xx@xx.net';
	
      //FIXME email, sms
	  String notifyAction= "email";   
      
	  //gps changeing satelite 
	  //boolean borderCrossing;
	
	  String notes='';
	
	  //String deviceCode;
	  //String deviceType;
	
	
	  String simPhoneNumber='';
	  String imeiNumber='';
	
	  int lastInputState;
	
	  String codeVersion='';
	  String featureSet='';
	  
	  //boolean ipAddressValid;
	  //String ipAddressCurrent;
	  
	
	  boolean isActive=true	  
	  
	  Date lastUpdated
	  Date dateCreated
	
	
	 static constraints  = {
		 notifyEmail(email:true)
		 notifyAction(inList:["email","SMS"])
		 //simPhoneNumber()//TODO phone-number validator
		 //ipAddressCurrent()//TODO ip-address validator 		 
	 }
}
